package com.warm.netty;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

public class ServerChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        // 添加编解码，可根据需求自行修改
//        socketChannel.pipeline().addLast("decoder", new StringDecoder(CharsetUtil.US_ASCII));
//        socketChannel.pipeline().addLast("encoder", new StringEncoder(CharsetUtil.US_ASCII));
        socketChannel.pipeline().addLast(new NettyServerHandler());
    }
}
